package com.gupao.jly521.proxy.staticed;

import com.gupao.jly521.entity.Person;
import com.gupao.jly521.entity.ProgramPerson;

/**
 * @author Jly
 * @date 2018/8/22  16:09
 */
public class StaticProxy {

    private Person person;

    //如果有带参数的构造函数，无参构造函数不会默认生成
    private StaticProxy() {

    }

    public StaticProxy(Person person) {
        this.person = person;
    }

    public void findJob() {
        System.out.println("执行找到工作前！！！！！！！！！");
        this.person.findJob();
        System.out.println("执行找到工作后！！！！！！！！！");
    }

    public static void main(String[] args) {
//        StaticProxy proxyDef = new StaticProxy();
        StaticProxy proxy = new StaticProxy(new ProgramPerson());
        proxy.findJob();

    }

}
